#!/bin/sh

echo "当前容器日志大小"
find /var/lib/docker/containers -type f -name "*.log" -exec ls -lh {} \;
echo "5s后开始清空，取消请ctrl+c"
sleep 5
echo "清空容器日志中"
for i in `find /var/lib/docker/containers -type f -name "*.log"`; do cat /dev/null >$i; done
sleep 3
echo "清空后容器日志大小"
find /var/lib/docker/containers -type f -name "*.log" -exec ls -lh {} \;
sleep 3
echo "完成"

